1. Field of the Invention
The present invention relates to a semiconductor memory device, and more specifically to a semiconductor memory device that includes, non-volatile erasable semiconductor memory, such as flash memory that can be addressed by memory sectors.
2. Description of the Background
External storage device:
In accordance with recent developments in technologies, various types of personal computers, such as desktop computers for use in offices and notebook computers for use in mobile environments, have been developed and marketed. Generally, these computer systems include main memory and an external storage device. It is preferable that the external storage device has a large memory capacity with a low storage capacity unit cost.
The external storage devices may be conventional hard disk drives (HDD) or floppy disk drives (FDD) that employ disk storage media. These disk storage devices typically provide large memory capacity at relatively low prices and operating costs; but, require highly delicate mechanical technology to perform various operations with a magnetic head, such as a disk seek operation. Accordingly, the disk storage devices may be easily damaged by physical impact and therefore considered less reliable than other types of memory devices.
In the past, external memory devices of the type that use semiconductor memory as a storage medium, such as SRAM (static random access memory) or DRAM (dynamic random access memory) have not provided a viable alternative to disk storage devices. Although semiconductor type external memory devices have faster processing speeds than disk access times and are less likely to be damaged upon physical impact, inherent drawbacks associated with SRAM and DRAM technology have prevented the use of SRAM and DRAM technology for mass storage.
In general, the price per memory capacity of SRAM is too high to make SRAM cost-effective for mass storage. Furthermore, the additional power required to save data held in DRAM typically increases the operating costs of the external storage device, and the power consumption associated with a DRAM refresh operation makes it difficult to implement DRAM in mobile environments where reduced power consumption is typically desirable.
On the other hand, external semiconductor memory devices that are implemented with flash memory, such as flash EEPROM (electrically erasable read-only-memory) provides a viable alternative to disk storage devices in certain applications. Flash memory devices are non-volitile memory devices that may be programmed more than once. Furthermore, flash memory devices have a simple structure that may be easily implemented. Because flash memory devices typically have low power consumption, are compact and light, and are less likely to be damaged from physical impact, they are often well suited for mobile environments, despite the trade-offs associated with flash memory devices. These trade-offs may include the requirement that an erase operation is performed prior to a programming (or re-write) operation, the requirement for a high voltage (e.g., 12 v or 20v) to perform erase operation, and the requirement that a relative large memory unit that may include several KB to several hundreds of KB must be erased simultaneously.
Accessing an external storage device:
A computer system (hereinafter also referred to as a "host") accesses an external storage device, such as an HDD, by designating a logical address. The logical address refers to a position among a logical memory space which host software (i.e., an operating system or an application) recognizes, as compared to a physical storage location. Thus, a logical address is converted into a physical address corresponding to a physical memory space in the external storage device in order to access the addressed physical memory space.
Typically, an external storage device that uses flash memory requires additional software, referred to as disk emulation software, to ensure compatibility with the host during an access operation. Compatibility between the host and the external flash storage device during an access operation may be acheived by running a file system such as MS-FFS (flash file system) or FTL (flash translation layer) on the host. Alternatively, compatibility between the host and the external flash storage device during an access in operating may be achieved by running a conventional file system such as PCMCIA ATA (at attachment) to emulate a HDD inside the external flash memory device. In other words, the host recognizes the external flash memory device as a HDD and accesses the external flash memory device in the same manner as a HDD.
When the host runs the FFS or FTL file system, the structure of the external semiconductor memory device may be simplified, and its price satisfactorily low. However, the overhead relative to the host may be increased, and problems may arise concerning compatibility between conventional programs and device drivers, and compatibility between different device drivers. On the other hand, when a conventional file system such as PCMCIA ATA is used to emulate the HDD, although the structure of an external semiconductor memory device is complicated, the host can handle the semiconductor memory device in the same manner as it does a conventional HDD, and no compatibility problems typically occur. As the memory capacity is increased, the price difference between the two systems is reduced, and the second system is therefore used in many cases.
When a conventional file system is used to emulate a HDD, two types of systems may be used. A first type includes a system for fixing a correspondence between a physical address and a logical address. A second type includes a system for varying a correspondence between a physical address and a logical address.
In the first type of system, when a write request is for fewer sectors than there are in a unit to be erased, the data in the unit to be erased must be temporarily read and saved in a transfer buffer, and then subsequently written back after the erasing has been performed. In the second type of system, information describing the correspondence between a logical address and a physical address must be stored and updated in an area other than the flash memory.
A conventional HDD file system divides a file into a data portion and a file management data portion (e.g., a FAT (File Allocation Table) or a directory), and stores them on a disk. When accessing the data portion, many sectors are accessed a few times. But when accessing the file management data portion, a few sectors are accessed many times. Because management information related to stored files is collectively placed in the file management data portion, access to the file management data portion is generally centralized.
Under the control of a conventional file system, the first type of system performs an erase operation each time an access is made. Thus, the efficiency of the system may be reduced, especially when a write operation is performed for a small number of sectors. Even when the first type of system performs the write operation for many sectors, efficiency is typically reduced unless the size of the data to be written matches the size of the erased unit. In the event that the power supply is suddenly cut off during an erase operation, all data in the transfer buffer, including data that is not to be written, is typically lost. On the other hand, the second type of system performs a write operation without conducting an erase operation as long as there is an empty sector. The second type of system is considered to be very efficient relative to the first type of system.
Flash memory devices are typically limited to the number of times each flash memory cell may be erased. Accordingly, the life of the flash memory device may be extended by uniform use of the entire flash memory device. The first type of system typically increases the frequency at which a file management data portion is written, and may be increased to such an extreme degree that the entire flash memory device can no longer provide reliable data. On the other hand, with the second type of system, even when data is written to the same logical address, the entire flash memory can be uniformly used by assigning different physical addresses. Because data is not erased for every write operation, the frequency at which the flash memory is erased is fewer than those of the first type of system. Generally, the second type of system is regarded as superior to the first type of system.
One embodiment of an external semiconductor memory device employing the second type of system is described below. FIG. 11 illustrates the structure of a physical memory space in an external flash memory device of the second type of system. The flash memory device includes a plurality of physical sectors. A physical sector address is sequentially allocated for each physical sector, beginning at the head sector in the physical memory space. One physical sector has a length of 528 bytes, and consists of three fields: a 6-byte header portion, a 512-byte data portion, and a 10-byte ECC portion. The header portion is used to store a logical sector address of the physical sector currently being allocated and a CRC (Cyclic Redundancy Check) code. The data portion stores the data body to be accessed. The ECC portion stores an error correction code. By including the CRC in the header portion, detection of errors can be performed after the head portion has been read. Correction of errors can be performed by using the ECC after all the sectors have been read.
According to FIG. 11, a logical sector address is provided for each physical sector that represents a minimum addressable unit. A memory device also referred to as a work memory stores a sector Location Table (SLT) that contains information for converting a logical sector address into a physical sector address. FIG. 12 illustrates the structure of the SLT. Each entry in the SLT corresponds to a logical sector entered in address order beginning at the head, and includes a field for storing the address of the physical sector that is currently being allocated for a corresponding logical sector. When access to the logical address #n is requested, the n-th entry from the beginning of the SLT is referenced to obtain a corresponding physical sector address.
A semiconductor memory, such as a DRAM, may be used as a work memory for storing the SLT. During a power-on operation or a reset operation, the header portions of all the physical sectors in the flash memory are scanned and logical address-physical address conversion information (SLT) is prepared in the work memory. During an access operation, the work memory is referenced to quickly acquire a physical address. The SLT, may be updated easily and rapidly.
By incorporating flash memory for storing data and files and a work memory for managing position information into an external semiconductor device, address information may be acquired immediately, and the flash memory may be accessed more efficiently.
Size of work memory;
The size of the SLT, is proportional to the number of sectors included in the memory space. As the memory capacity of the flash memory is increased and the size of the SLT is also increased, the capacity of the work memory area for storing the SLT is increased.
A flash memory having 64 MB, may include 120 K or more physical sectors, each of which consists of approximately 500 bytes. A minimum of 17-bits is required for the sector address of 120 K physical sector . Because a computer typically operates in byte units, a minimum of three bytes (=24-bit&gt;17-bit) may be required for each entry in the sector location table (SLT) in order to store the physical sector addresses. The number of entries required to be stored in the SLT is equivalent to the number of sectors in the memory space. For example, the size required for the SLT may be approximately 360 K bytes for 120 K entries. As the capacity of the flash memory as a storage medium is increased, the capacity of the work memory must also be increased. A large work memory typically affects the price of the external semiconductor memory device.
The work memory is a volatile memory device that is used to temporarily stores data. When the memory device is powered on or when a reset has occurred, no address conversion information, such as the SLT, is stored in the work memory. Generally, the preparation of the SLT is part of the power on operation of the external semiconductor memory device. To prepare the SLT, the header portions of all the physical sectors are searched. When the capacity of flash memory used as a storage medium increases and the number of sectors is increased proportionally, the time for the preparation of the SLT is accordingly extended, and the period needed for the power on process is lengthened.
Thus, when the work memory becomes larger, an additional saving operation is required, which results in the increased power consumption.